function ajax(obj) {

    //判断函数是否存在
    if(!obj.success || typeof obj.success != "function")return console.error("success is wrong!!");
    if(!obj.url || typeof obj.url != "string")return console.error("url is wrong!!");

    var xhr;
    if(window.XMLHttpRequest){
        xhr = new XMLHttpRequest()
    }else{
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhr.open("get",obj.url,true);
    xhr.send();
    xhr.onreadystatechange = function(){
        if(xhr.readyState == 4){
            if(xhr.status==200){
                obj.success(xhr.responseText)
            }
        }
    };
}